var express = require('express');
var router = express.Router();
var { usertagsModel } = require('../../../model/model');
/* GET home page. */

router.get('/', async (req, res) => {
  const WebSocket = require('ws');
  const ws = new WebSocket('ws://localhost:8080');

  ws.on('open', () => {
    console.log('Connected to server');
    ws.send('Hello from Client 1');
  });

  ws.on('message', (message) => {
    console.log(`Received message: ${message}`);
  });

  ws.on('close', () => {
    console.log('Disconnected from server');
  });

})
 
module.exports = router;
 